home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tpdev.arc / TPDEV.DOC < prev    next >
Text File  |  1991-09-27  |  1KB  |  42 lines

  1.  
  2. They said it couldn't be done!  (In fact, I think I was one of the naysayers...)
  3.  
  4.  
  5. "TP can't create the special format of file that's needed for a device driver."
  6.  
  7.  
  8. Wrong!!
  9.  
  10. I've written a simple device driver in TP, and it works.  From some things I've
  11. heard, it won't work in all versions of DOS (it's an .EXE format device driver,
  12. not a .BIN format one).  There are tons of restrictions on what you can do in it
  13. - DOS isn't reentrant, and the TP system library isn't designed to do things
  14. while DOS is active, so I don't even let it get initialized, etc., etc.
  15.  
  16. It's still a bit of a mess, but here it is, for your enjoyment and edification:
  17. a character device driver that keeps a buffer of 255 characters, called
  18. TPDEVICE.
  19.  
  20. To try it out, compile it (you'll need OPro or TPro; sorry, but stack swapping
  21. is essential, and I wouldn't want to try to write code to do it myself), put it
  22. into your CONFIG.SYS (on a floppy disk, please!) as
  23.  
  24.   device=tpdev.exe
  25.  
  26. and then reboot.   Hopefully you won't crash, but if you do, you'll have to
  27. reboot from a different disk and remove it from CONFIG.SYS.
  28.  
  29. Then you can try
  30.  
  31.   COPY TPDEVICE CON
  32.  
  33. to see the initialization message, and
  34.  
  35.   ECHO This is a line for the buffer >TPDEVICE
  36.  
  37. to replace it with a new one.
  38.  
  39. Enjoy!!
  40.  
  41. Duncan Murdoch
  42. May, 1991